{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "разбор ДЗ 4.ipynb",
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3 (ipykernel)",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.8.12"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "7lf2z6hukbfR"
      },
      "source": [
        "## Практическое задание\n",
        "\n",
        "Все задания рекомендуется выполнять вручную, затем проверяя полученные результаты с использованием Numpy.\n",
        "\n",
        "__1.__ Вычислить определитель:\n",
        "\n",
        "   a)\n",
        "\n",
        "### $$\\begin{vmatrix}\n",
        "sinx & -cosx\\\\ \n",
        "cosx & sinx\n",
        "\\end{vmatrix};$$\n",
        "\n",
        "   б)\n",
        "    \n",
        "### $$\\begin{vmatrix}\n",
        "4 & 2 & 3\\\\ \n",
        "0 & 5 & 1\\\\ \n",
        "0 & 0 & 9\n",
        "\\end{vmatrix};$$\n",
        "    \n",
        "   в)\n",
        "\n",
        "### $$\\begin{vmatrix}\n",
        "1 & 2 & 3\\\\ \n",
        "4 & 5 & 6\\\\ \n",
        "7 & 8 & 9\n",
        "\\end{vmatrix}.$$\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "hRUECbLWkbfa"
      },
      "source": [
        "a) \n",
        "### $$sin(x)\\cdot sin(x) - cos(x)\\cdot (-cos(x)) = sin^{2}(x) + cos^{2}(x) = 1$$ \n",
        "\n",
        "б)\n",
        "### $$ 4\\cdot 5\\cdot 9=180 $$\n",
        "\n",
        "в)\n",
        "### $$\\begin{vmatrix}\n",
        "1 & 2 & 3\\\\ \n",
        "4 & 5 & 6\\\\ \n",
        "7 & 8 & 9\n",
        "\\end{vmatrix}=$$\n",
        "### $$=7\\cdot (12−15)−8\\cdot (6−12)+9\\cdot (5−8)=−21+48−27=0$$  "
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "BO8gWU_6kbfe"
      },
      "source": [
        "\n",
        "__2.__ Определитель матрицы $A$ равен $4$. Найти:\n",
        "\n",
        "   а) $det(A^{2})$;\n",
        "    \n",
        "   б) $det(A^{T})$;\n",
        "    \n",
        "   в) $det(2A)$.\n",
        "   \n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "A_d6EP6ukbfg"
      },
      "source": [
        "а) $det(A^{2})=16$\n",
        "\n",
        "б) $detA^{T}=detA=4$\n",
        "\n",
        "в) $det(2A)=2^{n}detA=4\\cdot 2^{n}$."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "fZsCRCrMkbfm"
      },
      "source": [
        "__3.__  Доказать, что матрица\n",
        "\n",
        "### $$\\begin{pmatrix}\n",
        "-2 & 7 & -3\\\\ \n",
        "4 & -14 & 6\\\\ \n",
        "-3 & 7 & 13\n",
        "\\end{pmatrix}$$\n",
        "   \n",
        "вырожденная.\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "TysqPneUkbfp"
      },
      "source": [
        "Строка 1 и 2 являются линейно зависимы $$ x_{2} = -2⋅x_{1} $$"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "tmOZBv53kbfw"
      },
      "source": [
        "__4.__ Найти ранг матрицы:\n",
        "\n",
        "   а) \n",
        "   ### $$\\begin{pmatrix}\n",
        "1 & 2 & 3\\\\ \n",
        "1 & 1 & 1\\\\ \n",
        "2 & 3 & 4\n",
        "\\end{pmatrix}$$\n",
        "\n",
        "### $$\\begin{pmatrix}\n",
        "1 & 2 & 3\\\\ \n",
        "0 & -1 & -2\\\\ \n",
        "0 & -1 & -2\n",
        "\\end{pmatrix}$$\n",
        "\n",
        "   б) \n",
        "   ### $$\\begin{pmatrix}\n",
        "0 & 0 & 2 & 1\\\\ \n",
        "0 & 0 & 2 & 2\\\\ \n",
        "0 & 0 & 4 & 3\\\\ \n",
        "2 & 3 & 5 & 6\n",
        "\\end{pmatrix}$$\n",
        "\n",
        "### $$\\begin{pmatrix}\n",
        "0 & 0 & 2 & 1\\\\ \n",
        "0 & 0 & 0 & 1\\\\ \n",
        "0 & 0 & 0 & 0\\\\ \n",
        "2 & 3 & 5 & 6\n",
        "\\end{pmatrix}$$"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "6y0iQl5bkbhF",
        "outputId": "0ac53689-e9eb-4fe0-a0a1-b6ed76630890"
      },
      "source": [
        "import numpy as np\n",
        "\n",
        "x = [1, 2, 3]\n",
        "y = [1, 1, 1]\n",
        "z = [2, 3, 4]\n",
        "\n",
        "a = np.array([x, y, z])\n",
        "r = np.linalg.matrix_rank(a)\n",
        "\n",
        "print(f'Ранг матрицы: {r}')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Ранг матрицы: 2\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "jJQ6Df6lkbhR",
        "outputId": "fb8c50b9-1a09-4f60-b91d-8b076ec9405a"
      },
      "source": [
        "x = [0, 0, 2, 1]\n",
        "y = [0, 0, 2, 2]\n",
        "z = [0, 0, 4, 3]\n",
        "c = [2, 3, 5, 6]\n",
        "\n",
        "a = np.array([x, y, z, c])\n",
        "r = np.linalg.matrix_rank(a)\n",
        "\n",
        "print(f'Ранг матрицы: {r}')"
      ],
      "execution_count": null,
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Ранг матрицы: 3\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "liG4JylRW9vU"
      },
      "source": [
        ""
      ],
      "execution_count": null,
      "outputs": []
    }
  ]
}